<template>
	<view class="tui-label__box" :class="{ 'tui-label__full': isFull }" :style="{ padding: padding, margin: margin }" @tap.stop="onClick"><slot></slot></view>
</template>

<script setup>
import { ref } from 'vue'

const emit = defineEmits([])

const props = defineProps({
	//该组件主要用于tui-radio，tui-checkbox，tui-switch组件外层，类似label功能
	padding: {
		type: String,
		default: '0'
	},
	margin: {
		type: String,
		default: '0'
	},
	isFull: {
		type: Boolean,
		default: false
	}
})

let children = []

const onClick = () => {
	if (children && children.length > 0) {
		for (let child of children) {
			child.labelClick()
		}
	}
}
</script>

<style lang="scss" scoped>
.tui-label__box {
	/* #ifndef APP-NVUE */
	box-sizing: border-box;
	/* #endif */
}

.tui-label__full {
	flex: 1;
	/* #ifndef APP-NVUE */
	width: 100%;
	/* #endif */
}
</style>
